package icu.d4peng.basic.core.exception;

/**
 * AbstractException:异常父类
 *
 * @author d4peng <a href="d4peng@qq.com">d4peng@qq.com</a>
 * @since 2023.12.02
 */
public abstract class AbstractException extends RuntimeException implements BaseException {

	/**
	 * 错误信息
	 */
	private final String msg;

	/**
	 * 错误码
	 */
	private final Integer code;

	public AbstractException(final String msg, final Integer code) {
		super(msg);
		this.code = code;
		this.msg = msg;
	}

	public AbstractException(final String msg, final Integer code, final Throwable cause) {
		super(msg, cause);
		this.code = code;
		this.msg = msg;
	}

	@Override
	public String getMsg() {
		return msg;
	}

	@Override
	public Integer getCode() {
		return code;
	}

}
